package com.ruoyi.project.naming.namesentence.service.impl;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.project.naming.namesentence.domain.NameSentence;
import com.ruoyi.project.naming.namesentence.mapper.NameSentenceMapper;
import com.ruoyi.project.naming.namesentence.service.INameSentenceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 起名名句Service业务层处理
 *
 * @author shixiangwen
 * @date 2022-07-28
 */
@Service
@DataSource(DataSourceType.DICT)
public class NameSentenceServiceImpl implements INameSentenceService {
    @Autowired
    private NameSentenceMapper nameSentenceMapper;

    /**
     * 查询起名名句
     *
     * @param id 起名名句ID
     * @return 起名名句
     */
    @Override
    public NameSentence selectNameSentenceById(Long id) {
        return nameSentenceMapper.selectNameSentenceById(id);
    }

    /**
     * 查询起名名句列表
     *
     * @param nameSentence 起名名句
     * @return 起名名句
     */
    @Override
    public List<NameSentence> selectNameSentenceList(NameSentence nameSentence) {
        return nameSentenceMapper.selectNameSentenceList(nameSentence);
    }

    /**
     * 新增起名名句
     *
     * @param nameSentence 起名名句
     * @return 结果
     */
    @Override
    public int insertNameSentence(NameSentence nameSentence) {
        return nameSentenceMapper.insertNameSentence(nameSentence);
    }

    /**
     * 修改起名名句
     *
     * @param nameSentence 起名名句
     * @return 结果
     */
    @Override
    public int updateNameSentence(NameSentence nameSentence) {
        return nameSentenceMapper.updateNameSentence(nameSentence);
    }

    /**
     * 删除起名名句对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteNameSentenceByIds(String ids) {
        return nameSentenceMapper.deleteNameSentenceByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除起名名句信息
     *
     * @param id 起名名句ID
     * @return 结果
     */
    @Override
    public int deleteNameSentenceById(Long id) {
        return nameSentenceMapper.deleteNameSentenceById(id);
    }
}
